package com.itheima.day3.stream;

import java.util.stream.IntStream;

public class C08MatchTest {
    public static void main(String[] args) {
        IntStream stream = IntStream.of(1, 2, 3, 4, 5, 6);

        // 检查是否有偶数
        System.out.println(stream.anyMatch(x -> (x & 1) == 0));  // true
        // 检查是否所有元素都是偶数
        System.out.println(stream.allMatch(x -> (x & 1) == 0));  // false
        // 检查是否所有元素都不是偶数
        System.out.println(stream.noneMatch(x -> (x & 1) == 0));  // false
    }
}
